﻿using Sharp.Domain.Model;
using Sharp.Domain.PlatformBoundedContext.OrgModule.Aggregates;
using Sharp.Infrastructure;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Sharp.Domain.PlatformBoundedContext.UserModule.Aggregates;

namespace Sharp.Domain.PlatformBoundedContext.PersonModule.Aggregates
{

    /// <summary>
    /// 人员
    /// </summary>
    public partial class Person : IEntity<int>, IFilter4Org
    {
        public Person()
        {
        }
        [Index("IX_OrgId", 1)]
        public int Id { get; set; }

        /// <summary>
        /// 全名
        /// </summary>
        [MaxLength(50)]
        public string FullName { get; set; }
        /// <summary>
        /// 姓名简拼
        /// </summary>
        [MaxLength(50)]
        public string Jianpin { get; set; }

        /// <summary>
        /// 身份证
        /// </summary>
        [MaxLength(50), NonUnicode]
        public string IdCard { get; set; }
        /// <summary>
        /// 出生年月
        /// </summary>
        [MaxLength(8), NonUnicode]
        public string Birthday { get; set; }

        /// <summary>
        /// 户籍
        /// </summary>
        [MaxLength(50)]
        public string RegisteredResidence { get; set; }

        /// <summary>
        /// 手机
        /// </summary>
        [MaxLength(50), NonUnicode]
        public string Phone { get; set; }
        /// <summary>
        /// 传真
        /// </summary>
        [MaxLength(100), NonUnicode]
        public string Fax { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        [MaxLength(100), NonUnicode]
        public string Email { get; set; }
        /// <summary>
        /// 家庭地址
        /// </summary>
        [MaxLength(200)]
        public string Address { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [MaxLength(255)]
        public string Remark { get; set; }

        /// <summary>
        /// 所属组织Id
        /// </summary>
        [Index("IX_OrgId", 0)]
        public System.Guid? OrgId { get; set; }
        /// <summary>
        /// 所属组织
        /// </summary>
        public virtual Org Org { get; set; }

        /// <summary>
        /// 民族编码
        /// </summary>
        [Index]
        public string NationCode { get; set; }
        /// <summary>
        /// 性别编码
        /// </summary>
        [Index]
        public string GenderCode { get; set; }


        [ForeignKey("Id")]
        public User User { get; set; }
    }
}